package com.roowoo.plateform.fallback;

import com.roowoo.plateform.feign.FeignUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/***
 * @project: spring-cloud
 * @package: com.roowoo.plateform.fallback
 * @description: 服务降级处理
 * @author: kyrie
 * @mail: 18654169290@163.com
 * @createDate: 2022/3/17 11:07
 */
@Component
@Slf4j
public class FeignUserServiceFallback implements FeignUserService {
    @Override
    public String getUserInfo(String userId) {
        return this.getUserInfoFallback();
    }

    /**
     * Method fallback with getUserInfo
     */
    private String getUserInfoFallback() {
        log.error("服务被降级，执行Feign降级回退操作...");
        return "fallback-userinfo";
    }
}
